﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Lucandra.Configuration
{
    public class CassandraConnectionPoolElement : ConfigurationElement
    {
        [ConfigurationProperty("minConnections", DefaultValue = 10)]
        public int MinConnections
        {
            get { return (int)this["minConnections"]; }
            set { this["minConnections"] = value; }
        }

        [ConfigurationProperty("maxConnections", DefaultValue = 1000)]
        public int MaxConnections
        {
            get { return (int)this["maxConnections"]; }
            set { this["maxConnections"] = value; }
        }

        [ConfigurationProperty("magicNumber", DefaultValue = 7)]
        public int MagicNumber
        {
            get { return (int)this["magicNumber"]; }
            set { this["magicNumber"] = value; }
        }

        [ConfigurationProperty("maxClientPollAttempts", DefaultValue = 0)]
        public int MaxClientPollAttempts
        {
            get { return (int)this["maxClientPollAttempts"]; }
            set { this["maxClientPollAttempts"] = value; }
        }

        [ConfigurationProperty("cassandraEndpoints", IsRequired = true)]
        public CassandraEndpointCollection CassandraEndpoints
        {
            get { return (CassandraEndpointCollection)this["cassandraEndpoints"]; }
            set { this["cassandraEndpoints"] = value; }
        }
    }
}
